<%@ page import="com.edu.imau.ManagerRoleInformation.Manager" %>
<%@ page import="com.edu.imau.ParkingDao" %><%--
  Created by IntelliJ IDEA.
  User: 贾维斯
  Date: 2022/12/16
  Time: 15:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>角色信息管理界面</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
    <!-- Bootstrap core CSS -->
    <link href="bootstrap-3.4.1/css/bootstrap.min.css" rel="stylesheet">
    <!-- Custom styles for this template -->
    <link href="navbar-fixed-top/navbar-fixed-top.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs/dt-1.13.1/datatables.min.css"/>
</head>
<body>
<form class="form-inline" action="add2">
    <%--        <input type="hidden" name="id" value="<%= studentupdatae != null?studentupdatae.getId():""%>">--%>
    <input type="hidden" name="role_id" value="${manager.role_id}">
    <%--        <div class="form-group">--%>
    <%--            <label class="sr-only" style="width: 120px">序号</label>--%>
    <%--            <input type="text" class="form-control" name="id" id="id" placeholder="序号" style="width: 200px"value="${user.id}">--%>
    <%--        </div>--%>
    <div class="form-group">
        <label class="sr-only" style="width: 120px">用户编号</label>
        <input type="text" class="form-control" name="role_code" id="role_code" placeholder="用户编号" style="width: 250px"value="${manager.role_code}">
    </div>
    <div class="form-group">
        <label class="sr-only" style="width: 120px">角色名称</label>
        <input type="text" class="form-control" name="role_virtual_name" id="role_virtual_name" placeholder="角色名称" style="width: 250px" value="${manager.role_virtual_name}">
    </div><div class="form-group">
    <label class="sr-only" style="width: 50px" >用户</label>
    <input type="text" class="form-control" name="role_name" id="role_name" placeholder="用户" style="width: 250px"value="${manager.role_name}">
</div><div class="form-group">
    <label class="sr-only" style="width: 120px">真实姓名</label>
    <input type="text" class="form-control" name="role_true_name" id="role_true_name" placeholder="真实姓名" style="width: 250px"value="${manager.role_true_name}">
</div><div class="form-group">
    <label class="sr-only" style="width: 120px">用户密码</label>
    <input type="text" class="form-control" name="role_password" id="role_password" placeholder="用户密码" style="width: 250px"value="${manager.role_password}">
</div><div class="form-group">
    <label class="sr-only" style="width: 120px">联系方式</label>
    <input type="text" class="form-control" name="role_contact" id="role_contact" placeholder="联系方式" style="width: 250px"value="${manager.role_contact}">
</div>
    <button type="submit" class="btn btn-default" href="manager.jsp">确定</button>
</form>
<hr>
<!-- Main component for a primary marketing message or call to action -->
<table id="example" class="table table-bordered table-hover">
    <thead>
    <th>序号</th>
    <th>用户编号</th>
    <th>角色名称</th>
    <th>用户</th>
    <th>真实姓名</th>
    <th>用户密码</th>
    <th>联系方式</th>
    <th>操作</th>
    </thead>
    <tbody>
    <%Object list = request.getAttribute("data2");%>
    <%for(Manager manager:new ParkingDao().getManagerAll()){%>
    <tr>
        <td><%= manager.getRole_id() %></td>
        <td><%= manager.getRole_code() %></td>
        <td><%= manager.getRole_virtual_name() %></td>
        <td><%= manager.getRole_name() %></td>
        <td><%= manager.getRole_true_name() %></td>
        <td><%= manager.getRole_password() %></td>
        <td><%= manager.getRole_contact() %></td>
        <td>
            <a class="btn btn-warning" href="update2?role_id=<%= manager.getRole_id()%>" role="button">修改</a>
            <a class="btn btn-danger" href="delete2?role_id=<%= manager.getRole_id()%>" role="button">删除</a>

        </td>
    </tr>
    <%}%>
    </tbody>
</table>
</body>
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs/dt-1.13.1/datatables.min.js"></script>
<script>
    $(document).ready(function () {
        $('#example').DataTable();
    });
</script>
</html>
